open Lacaml.D;;

(* L^1 weighted norm of vector x *)
let primal w x =
  Lacaml_ext.D.Vec.nrm1 (Vec.mul w x);;

(* L^infty weighted norm of vector x *)
let dual w x =
  amax (Vec.div x w);;

(* orthogonal L^2 projection of vector x onto the L^1 weighted ball 
   with radius tau *)
let project w tau x =
  let ( y, itn ) = projector w tau x in
  y;; 
